<?php
/**
 * Created by PhpStorm.
 * User: 我型我素
 * Date: 2018/2/2
 * Time: 11:00
 */

namespace SDXApi\Service;


use Think\Model;

class OrderService
{
    public function __construct(){
    }

    public function getOrderInfoById($orderId){
        $map = array('order_id'=>$orderId);
        $order_info = M('order_info')->where($map)->find();

        return $order_info;
    }


    public function getOrderGoodsId($orderId){
        $map = array('order_id'=>$orderId);
        $order_goods_id = M('order_goods')->where($map)->getField('goods_id',true);

        return $order_goods_id;
    }

    public function getMaxPriceGoodsId($orderId,$goodsIdList){
        $map = array('order_id'=>$orderId,'goods_id'=>array('in',$goodsIdList));

        $goods_id = M('order_goods')->where($map)->order(array('goods_price'=>desc))->getField('goods_id');

        return $goods_id;
    }
}